package com.linkstec.json;

import java.util.Date;

import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

public class JacksonTest {

	public static void main(String[] args) {
		JsonFactory factory = new JsonFactory();
		factory.enable(JsonParser.Feature.ALLOW_SINGLE_QUOTES);
		ObjectMapper om = new ObjectMapper(factory);
//		ObjectMapper om = new ObjectMapper();
		
		JsonForTest jsonForTest = new JsonForTest();
		jsonForTest.setBusId("dd'd  dd");
		jsonForTest.setDdoubl(100000000.00);
		Date date = new Date();
		jsonForTest.setDate(date);
		String jsonString = null;
		try {
			jsonString = om.writeValueAsString(jsonForTest);
		} catch (JsonProcessingException e) {
			e.printStackTrace();
		}
		System.out.println(jsonString);

	}

}
